home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 1583 < prev    next >
Encoding:
Text File  |  1996-08-05  |  2.3 KB  |  73 lines

  1. Path: mystical.xs4all.nl!arcade
  2. Subject: Re: LoadRGB32()
  3. Newsgroups: comp.sys.amiga.programmer
  4. References: <4csqtl$ob3@rock101.genie.net>
  5. Distribution: world
  6. Organization: The AmigOS Project
  7. X-AmigOS-is-cool: TRUE
  8. X-Newsreader: TIN [AMIGA 1.3 950726BETA PL0]
  9. From: arcade@mystical.xs4all.nl (Pascal Eeftinck)
  10. Message-ID: <arcade.01g7@mystical.xs4all.nl>
  11. Date: Fri, 19 Jan 96 15:58:41 +0100
  12.  
  13. IAN J. EINMAN (i.einman@genie.com) wrote:
  14. > dc.l r, g, b, ...  (left justifies fraction)
  15. > repeat this as much as necessary; terminate with a count value of
  16. > zero.
  17. > For example:
  18. > unsigned long junk[] =
  19. > {
  20. >    2<<16 | 4,
  21. >    0xFFFFFFFF, 0x7FFFFFFF, 0x00000000,
  22. >    0x00000000, 0x00000000, 0xA0000000,
  23. >    0
  24. > }
  25. > LoadRGB32(viewp, junk);
  26.  
  27. If you want to do it right, you'll do this:
  28.  
  29. unsigned long junk[] =
  30. {
  31.    2<<16 | 4,
  32.    0xFFFFFFFF, 0x7F7F7F7F, 0x00000000,
  33.    0x00000000, 0x00000000, 0xA0A0A0A0,
  34.    0
  35. }
  36.  
  37. Where the colors represent their actual correct value as they should
  38. be according to the autodocs.
  39.  
  40. > will make color 4 be orange and color 5 be blue...  The left
  41. > justified fraction is importand, just shift the colors over three
  42. > bytes if they are 8 bit descriptors like such found in an IFF ILBM.
  43.  
  44. Wrong -> duplicate the amount of bits you have as long as you have
  45. bits to put them in.
  46.  
  47. Divide $F into 15 equal steps, you'll get $1 for each step.
  48. Divide $FF into 15 equal steps, you'll get $11 for each step.
  49. Divide $FFFFFFFF into 15 equal steps, you'll get $11111111 for each
  50. step.
  51.  
  52. All of the examples above have the same amount of steps. But all
  53. values are as well the maximum number you could put into those bits.
  54. Maximum brightness remains $F or $FFFFFFFF depending on the amount
  55. of bits you have available. Total darkness remains $0 (or $0000000).
  56. And when you take half of $FFFFFFFF to get half brightness,
  57. you'll get $7F7F7F7F, not $7FFFFFFF.
  58.  
  59. I know these are small differences, but if you try to make it right
  60. then there's little use not doing so, right?
  61. -- 
  62.        __ 
  63.       ///  Pascal Eeftinck -- C/C++ and Assembler Programmer -- Unix Freak
  64.      ///  AmigOS Project Coordinator -- GFX Freak -- Nick on IRC: Arcade
  65. __  ///  arcade@mystical.xs4all.nl -- pascalee@amigos.telesys-innov.fr 
  66. \\\///  $$$ <A HREF="http://www.xs4all.nl/~arcade/">My homepage</A> $$$
  67.  \\\/  Fight the right for privacy! -- finger arcade@xs4all.nl for PGP key
  68.  
  69.